import { defHttp } from "@/utils/http";

// 设备检查 VO
export interface eqpInspectsVO {
	inspId: string; // 检查ID
	inspType: string; // 检查类型
	eqpId: string; // 设备ID
	inspDt: Date; // 检查时间
	inspectorId: string; // 检查用户ID
	inspResult: string; // 检查结果
	inspDesc: string; // 描述
	status: string; // 状态
	createdBy: string; // 创建人
	createdTime: Date; // 创建时间
	updatedBy: string; // 更新人
	updatedTime: Date; // 更新时间
}

// 设备检查 API
export const eqpInspectsApi = {
	// 查询设备保险分页
	geteqpInspectsPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/eqp-inspects/page`, params });
	},

	// 查询设备保险详情
	geteqpInspects: async (id: number) => {
		return await defHttp.get({ url: `/whs/eqp-inspects/get?id=` + id });
	},

	// 新增设备保险
	createeqpInspects: async (data: eqpInspectsVO) => {
		return await defHttp.post({ url: `/whs/eqp-inspects/create`, data });
	},

	// 修改设备保险
	updateeqpInspects: async (data: eqpInspectsVO) => {
		return await defHttp.put({ url: `/whs/eqp-inspects/update`, data });
	},

	// 删除设备保险
	deleteeqpInspects: async (id: number) => {
		return await defHttp.delete({ url: `/whs/eqp-inspects/delete?id=` + id });
	},

	// 导出设备保险 Excel
	exporteqpInspects: async (params: any) => {
		return await defHttp.download({ url: `/whs/eqp-inspects/export-excel`, params });
	}
};
